﻿using WindowsGame.Device;
using WindowsGame.Input;
using Ninject.Modules;

namespace WindowsGame.IoC
{
	/// <summary>
	/// DynamicModule binds interface/implementation dependent on platform.
	/// </summary>
	public class DynamicModule : NinjectModule
	{
		public override void Load()
		{
#if WINDOWS_PHONE
			Bind<ADeviceFactory>().To<PhoneDeviceFactory>().InSingletonScope();
			Bind<AInputFactory>().To<PhoneInputFactory>().InSingletonScope();
#elif WINDOWS
			Bind<ADeviceFactory>().To<WorkDeviceFactory>().InSingletonScope();
			Bind<AInputFactory>().To<WorkInputFactory>().InSingletonScope();
#elif XBOX
			Bind<ADeviceFactory>().To<XboxDeviceFactory>().InSingletonScope();
			Bind<AInputFactory>().To<XboxInputFactory>().InSingletonScope();
#else
			throw new ArgumentOutOfRangeException("DynamicModule");
#endif
		}
	}
}
